package com.logistics.material.entity.model;

import com.logistics.pick.entity.model.PickDetailSave;
import com.logistics.utils.bean.SaveBasic;
import com.logistics.utils.tool.StringUtils;
import lombok.Data;

import java.util.List;

@Data
public class MaterialPickSave extends SaveBasic {

    private String id;
    private String code;
    private String status;
    private String pickId;

    private String itemSeqNo;

    private String erpInvBillType;
    // 物料名称
    private String itemName;
    // 物料单位
    private String itemUnit;
    // 物料数量
    private String itemQty;
    // 物料工序号
    private String itemOpNo;
    // 物料编号
    private String itemCode;
    // 托盘编号
    private String containerCode;
    // 领料单号
    private String erpInvBillCode;
    // 拣配单号
    private String pickCode;
    // 任务号
    private String taskNo;
    // 托盘位置
    private String station;

    private String deptCode;

    private String deptName;

    private String wcCode;

    private String wcName;

    private String nextStartDate;

    private String startPoint;

    private String startPointCode;

    private String endPoint;

    private String endPointCode;

    private List<ContainerSave> containerList;

    private List<PickDetailSave> detailList;

    private String location;

    public MaterialPickSave(){}

    public static MaterialPickSave build(String status,String pickId,String itemSeqNo, String itemName ,String itemUnit, String itemQty,
                                         String itemCode,String containerCode,String erpInvBillCode,
                                         String erpInvBillType,String taskNo,String station){
        MaterialPickSave materialPickSave = new MaterialPickSave();
        materialPickSave.setStation(status);
        materialPickSave.setPickId(pickId);
        materialPickSave.setItemSeqNo(itemSeqNo);
        materialPickSave.setItemName(itemName);
        materialPickSave.setItemUnit(itemUnit);
        materialPickSave.setItemQty(StringUtils.isNotNull(itemQty)? itemQty: null);
        materialPickSave.setItemCode(itemCode);
        materialPickSave.setContainerCode(containerCode);
        materialPickSave.setErpInvBillCode(erpInvBillCode);
        materialPickSave.setErpInvBillType(erpInvBillType);
        materialPickSave.setTaskNo(taskNo);
        materialPickSave.setStation(station);
        return materialPickSave;
    }

}
